<script setup>
import {useRouter}   from "vue-router";
const router = useRouter();
const  goChange = ()=>{
  router.push({
    "path":"/demo04/a"
  })
}
</script>

<template>
  <div>
    <h2>Page B.</h2> <br>
      <el-button type="primary">
        <router-link to="/demo04/a"  >router-link的方式跳转</router-link>
      </el-button>

    <el-button type="success" @click="goChange">
      <router-link to="/demo04/a"  >router-link的方式跳转</router-link>
    </el-button>
    </div>
</template>

<style scoped>
div {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  margin-top: 60px;
  background-color: #fafafa;
  font-size: 20px;
}

</style>